<?php
/**
 * Created by PhpStorm.
 * User: koterwong
 * Date: 2017/8/29
 * Time: 16:56
 */

namespace app\api\controller;

use cmf\controller\BaseController;
use app\api\model\UserModel;

class ApiBaseController extends BaseController
{

    public function _empty()
    {
        returnError(API_INVALID_REQUEST);
    }

    public function _initialize()
    {

        parent::_initialize();

        //提交方式必须是post
        if (!config("app_debug") && !$this->request->isPost()) {
            returnError(API_METHOD_ERROR);
        }

      /*  $userToken = input('token');
        if (!empty($userToken)) {
            $userModel = new UserModel();
            $userModel->checkToken($userToken);  //检验token信息，如果验证不通过，则不会继续请求。
        }*/
    }

}